package com.sss.demo.db.dao.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.stereotype.Repository;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.sss.demo.db.dao.IBaseDao;

@Repository("baseDao")
public class BaseDaoImpl implements IBaseDao {

	protected SqlMapClientTemplate sqlMapClientTemplate;
	@Autowired
	protected SqlMapClient sqlMapClient;

	public SqlMapClient getSqlMapClient() {
		return sqlMapClient;
	}

	public void setSqlMapClient(SqlMapClient sqlMapClient) {
		this.sqlMapClient = sqlMapClient;
	}

	@Override
	public SqlMapClientTemplate getSqlMapClientTemplate() {
		if (sqlMapClientTemplate == null) {
			sqlMapClientTemplate = new SqlMapClientTemplate(sqlMapClient);
		}
		return sqlMapClientTemplate;
	}

}
